<div class="row">
<div class="large-12 columns">
<?=$system_message;?>
<div class="panel">Set Payment Group Fees for <strong><?=ucwords($payment_group_desc['group_name']);?></strong></div>
<?=form_open('fees/view_payment_group/'.$hash_id,'class="custom"');?>
	<?if($set_tuit AND $set_misc AND $set_cca):?>
		<!--  Update -->
				<fieldset>
				<legend>Fees</legend>
					<a href="<?=site_url('fees/clear_payment_group_fees/'.$hash_id);?>" class="confirm btn btn-warning btn-mini" title="are you sure you want to clear payment group fees? Note this will not affect currently set student, only new students.">Clear Group Fees</a>
					<hr class="clearfix">
					<div>
						<label class="label">Tuition Fee</label>
						<input type="text" value="<?=$set_tuit->descs;?>" disabled>
						<!--<input type="hidden" name="current_tuit_id" value="<?=$set_tuit->id;?>">-->
					</div>
					
					<div>
						<label class="label">Miscellaneous Fee</label>
						<input type="text" value="<?=$set_misc->descs;?>" disabled>
						<!--<input type="hidden" name="current_misc_id" value="<?=$set_misc->id;?>">-->
					</div>
					
					<div>
						<label class="label">CCA Fee</label>
						<input type="text" value="<?=$set_cca->descs;?>" disabled>
						<!--<input type="hidden" name="current_cca_id" value="<?=$set_cca->id;?>">-->
					</div>
				</fieldset>
	<?else:?>
		<!--  Insert -->

				<fieldset>
				<legend>Fees</legend>
					<div>
						<label class="label">Tuition Fee</label>
						<?=form_dropdown('tuit',$tuit,set_value('tuit'),'required');?>
					</div>
					
					<div>
						<label class="label">Miscellaneous Fee</label>
						<?=form_dropdown('misc',$misc,set_value('misc'),'required');?>
					</div>
					
					<div>
						<label class="label">Matriculation Fee</label>
						<?=form_dropdown('cca',$cca,set_value('cca'),'required');?>
					</div>
					<input type="submit" name="create_payment_group_fees" class="btn btn-primary" value="Set Fees">
				</fieldset>
	<?endif;?>
<?=form_close();?>

<?=form_open('','class="custom"');?>
				<fieldset>
				<legend>Grade Levels Applied To</legend>
				<div class="alert alert-info">
					Changes will only affect new enrollees.
				</div>
				<table class="table">
					<thead>
						<tr>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
					</thead>
					<tbody>
						<tr class="success">
							<th colspan="3"> Selected Grade Levels<th>
						</tr>
						<?if($slevels):?>
							<?foreach($slevels as $slk => $slv):?>
								<tr>
									<td><input type="checkbox" value="<?=$slv->level_id;?>" checked disabled></td>
									<td><?=$slv->level_code;?></td>
									<td><?=$slv->level_desc;?></td>
									<td><a href="<?=site_url('fees/remove_level_from_group/'.__link($slv->level_id).'/'.__link($raw_id));?>" class="confirm btn btn-mini btn-warning" title="Confirm delete of grade level from group?, Note that this will only affect new incoming enrollees and not registered students">X<a></td>
								</tr>
							<?endforeach;?>
						<?else:?>
								<tr class="info">
									<td colspan="4">No Selected Levels</td>
								</tr>
						<?endif;?>
					</tbody>
					<tbody>
						<tr class="success">
							<th colspan="3">Available Grade Levels<th>
						</tr>
						<?if($ulevels):?>
							<?foreach($ulevels as $ulk => $ulv):?>
								<tr>
									<td><input type="checkbox" name="levels[]" value="<?=$ulv->level_id;?>"></td>
									<td><?=$ulv->level_code;?></td>
									<td colspan="2"><?=$ulv->level_desc;?></td>
								</tr>
							<?endforeach;?>
						<?else:?>
								<tr class="info">
									<td colspan="4">No Grade Levels To Display</td>
								</tr>
						<?endif;?>
					</tbody>	
				</table>
				<input type="submit" name="set_payment_group_grade_level" class="btn btn-primary" value="Set Grade Level">
				<a href="<?=site_url('fees/payment_group');?>" class="btn btn-mini">Go Back</a>
				</fieldset>
</div>
</div>